I wanted to list most recently updated file within a folder and needed to capture all file modified dates. After trying ls fs etc, I came upon filelist (ssc program created by Robert Picard) which return all files and 4 macros which I am not sure how to access. Do they involve dates? If anyone has a better way to access file modified dates so I can code to list files updated in the past 7 days, it will be useful.
Output from that is
Code:
/*
local roots ///
"C:/Users/Vijayalakshmi/Dropbox/Girish Files" ///
"C:/Users/NewPC/Dropbox/Girish Files" ///
"D:/gvenkataraman/Documents/Dropbox/Girish Files" ///
"D:/Dropbox/Girish Files"
local found 0
foreach r of local roots {
capture cd "`r'"
if !_rc {
local found 1
local dropbox "`r'"
continue, break
}
}
if !`found' {
di as error "Dropbox path not found on this PC."
exit 198
}
local stem "`dropbox'/gv_programs"
di "------------------------------------------------------------"
di "Dropbox base : `dropbox'"
di "GV programs : `stem'"
di "------------------------------------------------------------"
filelist, dir("`stem'") pattern("*.ado") list
Code:
Number of files found = 45
+---------------------------------------------------------------------------+
| filepath fsize |
|---------------------------------------------------------------------------|
| C:/Users/NewPC/Dropbox/Girish Files/gv_programs/cdgv.ado 261 |
| C:/Users/NewPC/Dropbox/Girish Files/gv_programs/coxer.ado 3,530 |
....
....
end of do-file
. ret li
scalars:
r(changed) = 1
r(width) = 129
r(k) = 4
r(N) = 45

Comment